package kiven.jee.model;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

import org.hibernate.annotations.GenericGenerator;

/**
 * Hibernate中主键为String类型的ID
 * 
 * @author kiven
 * @date 2013-02-28
 *
 */
@SuppressWarnings("serial")
@MappedSuperclass
public class StringIdObject implements IBaseEntity {
	// hibernate的uuid机制，生成32位字符
	protected String id;

	@Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid",strategy = "uuid")
	@Column(length = 32)
	public String getId() {
		return id;
	}
	
	public void setId(String id) {
		this.id = id;
	}
}
